/**
 * Description:
 * Class Name:NullTest
 * Date:2022/3/26 10:58
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第10章_异常处理._10_2_异常处理机制._10_2_2_异常类的继承体系;

import java.util.Date;

public class NullTest {
    public static void main(String[] args) {
        Date d = null;
        try{
            System.out.println(d.after(new Date()));
        }
        catch (NullPointerException ne){
            System.out.println("空指针异常");
        }
        catch (Exception e){
            System.out.println("unknown");
        }
    }
}
